#ifndef Action_H
#define Action_H
#include "utility.h"
//(*Headers(Action)
#include <wx/panel.h>
#include <wx/button.h>
#include <wx/dc.h>
#include <wx/timer.h>
//*)
#include <boost/function.hpp>
using namespace std;

class Action: public wxPanel
{
public:
	Action(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
	virtual ~Action();
	SActionInfo &GetActionInfo()
	{
		return m_actionInfo;
	}
	void SetActionInfo(SActionInfo &info)
	{
		m_actionInfo = info;
		if(m_isRun)
			Stop();
		Start();
	}
	
protected:

	//(*Identifiers(Action)
	static const long ID_BUTTON1;
	static const long ID_BUTTON2;
	static const long ID_BUTTON_DEL;
	static const long ID_BUTTON_DEL_FRAME;
	//*)
	//(*Declarations(Action)
	wxButton* m_pRunButton;
	wxButton* m_pStopButton;
	wxButton* m_pDelButton;
	wxButton* m_pDelFrameButton;
	//*)
private:
	void Start();
	void Stop();
	//(*Handlers(action)
	void OnPaint(wxPaintEvent& event);
	void OnBackground(wxEraseEvent &event);
	void OnTimer(wxTimerEvent &event);
	void Draw(wxDC &dc);
	size_t m_selLayer;
	bool m_isRun;
	size_t m_curDrawFrame;
	SActionInfo m_actionInfo;
	wxTimer m_timer;
	wxDECLARE_EVENT_TABLE();
};

#endif
